/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.rum.domainmodel;

import java.util.concurrent.atomic.AtomicLong;

/**
 *
 * @author pmikulasek
 */
public class ReflectorComponent {

    private static final AtomicLong idCounter = new AtomicLong();
    private final Long componentId;

    public ReflectorComponent() {
        componentId = idCounter.getAndIncrement();
    }

    public Long getId() {
        return componentId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof ReflectorComponent)) {
            return false;
        }
        ReflectorComponent other = (ReflectorComponent) obj;
        return componentId.equals(other.getId());
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 83 * hash + (this.componentId != null ? this.componentId.hashCode() : 0);
        return hash;
    }
}
